<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>修改密码</title> 
<%@ include file="/common/include.jsp" %>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
<script>
$(document).ready(function() {
	var status = "${status}";
	var pstatus = "${pstatus}";
	if(status.length>0){

		if(status=="1")
		{
			alert("修改成功！请用新密码重新登录");
			window.location.href="${pageContext.request.contextPath}/log/out";
		}else{
			alert("修改失败!");
			//window.location.href="${pageContext.request.contextPath}/log/out";
		}
	}
	if(pstatus.length>0){
		if(pstatus=="0")
			alert("旧密码输入错误，请重新输入！");
	}
});

function materialcreatesubmit() {
	var isValidatestate = true;
	var type_mask = '0';
	var cd_mask = '';
	var page = '1';
	var rows = '15';
	var r = /^[1-9]*[0-9][0-9]*$/; //正整数
	var t = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)([\w-]+\.)+(\S)+$/i;
	var te = /^([\w-]+\.)+(\S)+$/i;
	var a = /select|insert|update|dalete|\'|\/\*|\.\.\/|union|into|load_file|outfile/;
	var name = $.trim($("#s_id").val()); //获取广告位名称
	var txt_len = $.trim(name).length;
	
	name = $("#name").val();
	if(name ==''){
		$("#uname").show();
		$("#uname").html('帐号不能为空');
		return false;
	}
	$("#uname").hide();
	
	
	name = $("#opassword").val();
	if(name ==''){
		$("#tp_opassword").show();
		$("#tp_opassword").html('旧密码不能为空');
		return false;
	}
	$("#tp_opassword").hide();
	
	name = $("#password").val();
	if(name ==''){
		$("#tp_password").show();
		$("#tp_password").html('新密码不能为空');
		return false;
	}
	$("#tp_password").hide();
	
	name = $("#cpassword").val();
	if(name ==''){
		$("#tp_cpassword").show();
		$("#tp_cpassword").html('再次确认密码');
		return false;
	}
	$("#tp_cpassword").hide();
	
	
	name = $("#cpassword").val();
	pwd = $("#password").val();
	if(name != pwd){
		$("#tp_cpassword").show();
		$("#tp_cpassword").html('两次输入密码不一致');
		return false;
	}
	$("#tp_cpassword").hide();
	
	
	
	document.getElementById("form").submit();
}

function comeback() {
	window.location="${pageContext.request.contextPath}/page/userList.jsp";
}
</script>
</head>

<body>
<div class="wrapper">
	<jsp:include page="/common/header.jsp"><jsp:param value="1" name="nav"/></jsp:include>
	<div class="content" style="">
		<div class="col_l">
			<div class="l_top"></div>
			<div class="l_menu">
			      <jsp:include page="/common/l_system_place.jsp"><jsp:param value="1" name="nav"/></jsp:include>
			</div>
			<div class="l_bottom"></div>
		</div>
		<div class="col_r" style="">
			<div class="guide blue">
				<span class="left">当前位置：<a href="${pageContext.request.contextPath }/page/userList.jsp">用户管理</a> 编辑用户</span>
			</div>
			<div class="mx_title">
				<div class="cj_l"></div>
				<div class="cj_c"> 编辑用户</div>
				<div class="cj_r"></div>
			</div>                
			<form id="form" name="form" action="${pageContext.request.contextPath }/user/editPassword" method="post">				 
				<div class="cj_con" id="main" style="">
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr style="" id='trmaterialname'>
							<td width="14%" height="35" align="right">用户：</td>
                            <td width="2%" align="center"><div class="star">*</div></td>
                            <td width="84%">
                            	<input type="text" id='name' name="name" size="20"  readonly="readonly" value="${sys_user.name }" class="input_cj left" />                 
                            	<div class="tips_error left" style="display:none;"  id='uname'></div>
                             </td>
						</tr>
						<tr>
						<td>
						<input type="hidden" id="id" name="id" value="${sys_user.id}"></input>
						<input type="hidden" id="role" name="role" value="${sys_user.role}"></input>
						</td>
						</tr>
						<tr>
							<td height="35" align="right">旧密码：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="password"  size="20" class="input_cj" id="opassword" name="opassword" /></span>
								<div style="display:none;" class="tips_error left" id="tp_opassword"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">新密码：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="password"  size="20" class="input_cj" id="password" name="password" /></span>
								<div style="display:none;" class="tips_error left" id="tp_password"></div>
							</td>
						</tr>
						<tr>
							<td height="35" align="right">确认密码：</td>
							<td align="center"><div class="star">*</div></td>
							<td colspan="2">
								<span class="left"><input type="password"  size="20" class="input_cj" id="cpassword" name="cpassword" /></span>
								<div style="display:none;" class="tips_error left" id="tp_cpassword"></div>
							</td>
						</tr>
		
					</table>
					<div style=" margin-left:120px; margin-top:10px;">
						<a href="javascript:void(0)" id='onsubmit'>
							<img onclick="materialcreatesubmit();" src="${pageContext.request.contextPath}/images/over.gif" />
					  	</a>
					    <img onclick='comeback();'src='${pageContext.request.contextPath}/images/formcacle.gif' style="margin-left:15px;cursor:pointer"/>
					</div>
				</div>
			</form> 
		</div>
		 
		   <div class="clear"></div>
		   
	  </div>

<div class=footer>CopyRight &copy;Research Institute of Computer Systems of SCUT. All Rights Reserved
	</div>
</div>
<script>
function showHelp(obj){
var help = document.getElementById("key"+obj).style.display;
document.getElementById("key"+obj).style.display="";

} 

function closeHelp(obj){
var help = document.getElementById("key"+obj).style.display;
document.getElementById("key"+obj).style.display="none";
}
	</script>
</body>
</html>